<?php
    /**
     * Created by PhpStorm.
     * User: mybook-lhp
     * Date: 18/9/19
     * Time: 下午3:09
     */

    namespace app\member\model;


    use think\Model;

    class MessageModel extends Model
    {

        protected $name = 'member_message';

        // 自动写入时间戳
        protected $autoWriteTimestamp = true;

        protected $dateFormat = 'Y/m/d H:s';

        const IS_NOT_VIEW = 0;
        const IS_VIEW     = 1;

        /**
         *
         * @param $member_id
         * @param $list_rows
         *
         * @throws \think\exception\DbException
         */
        static public function lists($member_id,$list_rows)
        {

            return self::where(['type' => 0])->whereOr(['member_id' => $member_id])->order('create_time','desc')->paginate($list_rows);

        }
    }